import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/index'
import login from '@/pages/login/index'
import index from '@/pages/index'
import test from '@/pages/test/index'
import cronTest from "@/test/cronTest"
import page404 from '@/components/404.vue'


import flowRouter from "./flow-router"
import entRouter from "./ent-router"
import xtglRouter from "./auth"
import myworkRouter from "./mywork"
import creditRouter from "./credit-router"
import projectRouter from './project-router';
import finRouter from "./fin-router"
import angle from './angle-router';
import potalRouter from './potal-router';

import afterRouter from './after-router';
import logRouter from './log-router';

import messRouter from './mess-router';
Vue.use(Router)

export default new Router({
    routes: [{
        path: '/login',
        name: 'login',
        component: login,

    },
    {
        path: '/',
        name: 'Home',
        redirect: '/home',
        component: Home,

        children: [
            {
                path: '/test',
                name: 'test',
                component: test,
                meta: {
                    title: 'myForm(test)',
                    icon: '',
                    noCache: true,
                    affix: true,
                },
        
            },
            {
                path: '/cronTest',
                name: 'cronTest',
                component: cronTest,
                meta: {
                    title: 'cronTest',
                    icon: '',
                    noCache: true,
                    affix: true,
                },
        
            },
            {
                path: '/home',
                name: 'index',
                component: index,
                meta: {
                    title: '首页',
                    icon: 'dashboard',
                    noCache: true,
                    affix: true,
                    all: true
                },
            },
            ...flowRouter
        ]
    },
    {
        path: '/xtgl',
        name: 'xtgl',
        redirect: '/xtgl/jsgl',
        component: Home,
        children: [
            ...xtglRouter
        ]
    },
    {
        path: '/ent',
        name: 'ent',
        redirect: '/ent/ent',
        component: Home,
        children: [
            ...entRouter
        ]
    },
    {
        path: '/mywork',
        component: Home,
        children: [
            ...myworkRouter
        ]
    },
    {
        path: '/credit',
        name: 'credit',
        redirect: '/credit/credit',
        component: Home,
        children: [
            ...creditRouter
        ]
    },
    {
        path: '/proj',
        component: Home,
        children: [
            ...projectRouter
        ]
    },
    {
        path: '/finance',
        name: 'finance',
        redirect: '/finance/finance',
        component: Home,
        children: [
            ...finRouter
        ]
    },
    {
        path: '/angle',
        component: Home,
        children: [
            ...angle
        ]
    },
    {
        path: '/potal',
        component: Home,
        children: [
            ...potalRouter
        ]
    },{
        path: '/after',
        component: Home,
        children: [
            ...afterRouter
        ]
    },
    ,{
        path: '/log',
        component: Home,
        children: [
            ...logRouter
        ]
    },{
        path: '/mess',
        component: Home,
        children: [
            ...messRouter
        ]
    },  {
        path: '*',
        name: "404",
        component: page404

    }
    ]
})